package com.tengfei.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @Description: 自定义注解
 * @author: ten_fei
 * @date: 2021-07-15 9:56
 */
public class Test2 {

    @MyAnnotation2(name = "feige",age = 18,id = 1,schools = {"哈工大","国防科大"})
    public void test1(){

    }
}


@Target(value = {ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation2{
    // 注解的参，default为初始化默认值;
    String name() default "";
    int age() default 0;
    int id() default -1;

    String[] schools() default {"清华","北大"};
}